Skip to content
This repository has been archived by the owner on Jun 5, 2018. It is now read-only.

iOS: Re-running a test should respect shouldRunOnMainThread. #76

Closed
wants to merge 2 commits into from

Conversation

Inferis
Copy link

@Inferis Inferis commented Jan 24, 2012

If you re-ran a test, the test was always run on the main thread. This is different behavior from the runs in the complete test suite.

These commits pass along the test group with the test to the detail controller, which then uses the context of the group to re-run the test. It actually creates a new group with the same context, with only (a copy of) the test to re-run in it.

…group.

setTest: was modified to setTest:group:

This is necessary to properly rerun the test. Without the group the testCase's shouldRunOnMainThread isn't called, giving different behavior from this particular rerun versus the testsuite run.
@x2on
Copy link
Member

x2on commented Feb 17, 2012

+1
Thanks for this, i integrated this and it runs fine.

@drekka
Copy link

drekka commented Feb 19, 2012

Not sure if I've read this correctly, but I've just encountered a problem where a test works fine when run from the suite view, but crashes when run from the test view. The issue is the test includes threading code which assumes that it is not running on the main thread, but GHUnit runs the test on the main thread when the Run button is tapped.

I think I have the inverse of this bug in that I don't want it run on the main thread.

@Inferis
Copy link
Author

Inferis commented Feb 20, 2012

My changes will fix that.

@x2on
Copy link
Member

x2on commented Oct 30, 2013

Is this relevant for the current master?

@x2on x2on closed this Feb 17, 2014
@kolyuchiy
Copy link

Yes, it's still relevant.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants